<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateKeywordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('keywords', function (Blueprint $table) {
            $table->id();
            $table->string('word')->comment('关键字');
            $table->tinyInteger('type')->default(1)->comment('匹配模式，1全匹配，2半匹配');
            $table->string('content')->comment('文字消息为回复内容，其他类型消息，这里保存其他表的外键');
            $table->tinyInteger('content_type')->default(1)
                ->comment('回复消息的类型，1文字，2图片，3音频，4视频，5图文');
            $table->string('desc')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('keywords');
    }
}
